package com.itheima.reggie.mapper;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmployeeMapper {
    @Select("SELECT * FROM employee WHERE username =#{username};")
    Employee login(Employee employee);

    @Insert("INSERT INTO employee VALUES (null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser});")

    void save(Employee employee);

    List<Employee> findByName(@Param("name") String name);

    void update(Employee employee);

    @Select("SELECT * FROM employee WHERE id = #{id};")
    Employee findById(Long id);

//    @Select("SELECT * FROM employee WHERE username = #{username};")
//    Employee login(Employee employee);
//
//    @Insert("INSERT INTO employee VALUES (null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser});")
//    void save(Employee employee);
//
//    List<Employee> findByName(@Param("name") String name);
//
//    void updateById(Employee employee);
//
//    @Select("SELECT * FROM employee WHERE id= #{id}")
//    Employee findById(Long id);
}
